<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>编辑资料</title>
    
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../css/own.css"/>
    <link rel="stylesheet" href="../css/mui.picker.min.css" />
    <link rel="stylesheet" href="../css/mui.poppicker.css" />
   
</head>
<body>
	
	<!--<header class="mui-bar mui-bar-nav">
		<button type="button" class="mui-action-back mui-btn  mui-btn-link mui-pull-left own-button" >
			<span class="mui-action-back mui-icon mui-icon-left-nav own-left-nav-color"></span>
			<span class="own-left-nav-color">取消</span>
		</button>
		<h1 class="mui-title">编辑资料</h1>
		
		<button type="button" class=" mui-btn  mui-btn-link mui-pull-right own-button" onclick="updateUserInfo()" >
			<span class="own-left-nav-color">完成</span>
		</button>
	</header>-->
	
	
				<div class="mui-content" style="background-color: #FFFFFF;">
				
						<div style="height: 100px;font-size: ;">
				
						<div class=""  style="border-radius: 100%; height: 80px; width: 80px; margin-top: 10px; margin-left: 5%;text-align: center;border:solid 1px #808080;float: left;">
							<span class="mui-icon mui-icon-person " style="line-height: 80px; font-size:72px; color: #808080;"></span>
							
						</div>
						<span   style="line-height: 100px;float: left; margin-left:5%;">修改头像</span>
						</div>
								
						
		<a href=""></a>
						<form class="mui-input-group">
							 
							
			    <div class="mui-input-row">
			        <label>昵称</label>
			    <input type="text" class="mui-input-clear" placeholder="" id="nickName" >
			    </div>
			    <div class="mui-input-row">
			        <label>性别</label>
			        <input type="text" class="mui-input-password" placeholder="" id="sex">
			        
			    </div>
			   
			   
			</form>
				
				
				
				
				

			</div>
			<script type="text/javascript" src="../js/jquery-1.11.1.min.js" ></script>
	<script src="../js/mui.min.js" charset="UTF-8"></script>
	<script src="../js/own.js" charset="UTF-8"></script>
	<script type="text/javascript" src="../js/mui.picker.min.js" ></script>
	<script type="text/javascript" src="../js/mui.poppicker.js" ></script>
	<script type="text/javascript" src="../js/city.data.js" ></script>
	<script type="text/javascript" src="../js/city.data-3.js" ></script>
	<script type="text/javascript" charset="UTF-8">
	var tokenCodes;
	var	accountIds;
		mui.plusReady(function() {   
			 tokenCodes	= plus.storage.getItem("tokenCode");
			 accountIds	= plus.storage.getItem("accountId");
			//alert(plus.storage.getItem("nickName"))
			//alert(plus.storage.getItem("nickName"))
			$("#nickName").val(plus.storage.getItem("nickName"));
			$("#sex").val(plus.storage.getItem("sex"));
			});
		
	</script>
	
	
	<script>
			(function($, doc) {
				$.init();
				$.ready(function() {
					//普通示例
					var userPicker = new $.PopPicker();
					userPicker.setData([{
						value: '男',
						text: '男'
					}, {
						value: '女',
						text: '女'
					}]);
					var showUserPickerButton = doc.getElementById('sex');
					var userResult = doc.getElementById('sex');
					showUserPickerButton.addEventListener('tap', function(event) {
						userPicker.show(function(items) {
							userResult.value = items[0].value;
							//返回 false 可以阻止选择框的关闭
							//return false;
						});
					}, false);
					//-----------------------------------------
					//级联示例
					
					//-----------------------------------------
					//					//级联示例
					
					
				});
			})(mui, document);
			
			
			
				window.addEventListener('navRightPress', function() {
								
								var data = {};
		data.tokenCode = tokenCodes;
		//alert(tokenCodes);
		data.accountId = accountIds;
		//alert(accountIds);
		data.nickName = $("#nickName").val();
		//alert(data.nickName);
		/*data.realName = $("#realName").val();
		data.cardType = $("#cardType").val();
		data.cardNO = $("#cardNO").val();
		data.birthday = $("#birthday").val();*/
		data.sex = $("#sex").val();
		//alert(data.sex);
		mui.ajax({
			url: url+"rest/updateAccount",
			type: "POST",
			data: data,
			success: function(result){
				//返回json字符串，转成json对象进行属性获取
				//{"status":"value","msg":"提示信息"}
				// status 为 0  表示 调用成功，为其他值则为失败
				result = JSON.parse(result);
			/*	$("#resultCode").val(result.status);
				$("#resultMsg").val(result.msg);*/
				if(result.status != '0'){
					mui.alert(result.msg );
				}else{
					
					plus.storage.setItem("nickName", $("#nickName").val());
				    plus.storage.setItem("sex", $("#sex").val());
				       
				     
				}
			}
		});
					
					
					
				mui.toast('修改成功');
				plus.storage.setItem("nickName",$("#nickName").val());
				var minewebview = plus.webview.getWebviewById('barItem/mine.html');
				
				mui.fire(minewebview, 'loginSuccess', {});
				

				mui.back();
			}, false)
			
		</script>
	
</body>
</html>